import {Component} from '@angular/core';
import {Router} from '@angular/router';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'ShopProgram';

  constructor(private router: Router) {

  }

  toProductDetails(): void {
    /*this.router.navigateByUrl('/product');*/
    /*可传递参数*/
    this.router.navigate(['/product', '123']);
  }

}
